Position Property (Attachment Object) 

The Position property returns or sets the position of the attachment within the body text of the message. Read/write.

Syntax

objAttachment.Position

Data Type

Long

Remarks

The Position property is a long integer describing where the attachment should be placed in the message body. The attachment overwrites the character present at that position. Applications cannot place two attachments in the same location within a message, and attachments cannot be placed beyond the end of the message body.

The OLE Messaging Library does not manage rendering of the attachment within the message. The Position property simply provides directions for the rendering application.

The value -1 indicates that the attachment is present, but is not rendered. The value 0 and other positive values indicate an index to the text character within the message.

The Position property corresponds to the MAPI property PR_RENDERING_POSITION.

Example

' from the function Attachments_Add()

    Set objAttach = objAttachColl.Add         ' add an attachment

    With objAttach

        .Type = mapiFileLink

        .Position = 0   ' place at beginning of message

        .Source = "\\server\bitmaps\honey.bmp"  ' UNC name

    End With

    ' must update the message to save the new info

    objOneMsg.Update   ' update the message

    MsgBox "Added an attachment of type mapiFileLink"

 

See Also

Add Method (Attachments Collection)YS6R2P, Text Property (Message Object)1DH3_DE